package com.hardydou.framework.quartz;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.hardydou.system.mapper.SystemUserMapper;
import com.hardydou.system.model.SystemUser;
import com.hardydou.system.service.ISystemUserService;
import com.hardydou.system.tasks.Task;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author ：hardy
 * @description：
 * @date ：Created in 2020/6/24
 * @Copyright ：Hardydou.com
 */
public class TaskOne extends Task {

    static Log log = LogFactory.get(TaskOne.class);

    @Autowired
    SystemUserMapper userMapper;

    @Override
    public void execute() {
        String param = getInvokeParam();
        SystemUser user = userMapper.selectByPrimaryKey(5l);
        log.info("run ==============={},{}", user.getUsername(), param);
        getContext().setResult("result");
    }
}
